<?php
// 后台用户模块
class BlockManageAction extends CommonAction {

	function _filter(&$map) {
	}

	protected function _search($name = '') {
		//生成查询条件
		$name  = $this->getActionName();
		$model = D($name);
		$map   = array();
		foreach ($model->getDbFields() as $key => $val) {
			if (isset($_REQUEST[$val]) && $_REQUEST[$val] != '') {
				$map[$val] = $_REQUEST[$val];
			}
		}
		return $map;
	}

	// 插入数据
	// public function insert() {
		// dump($_REQUEST);exit;
		// $data['commodity_id'] = $_REQUEST['commodity_id'];
		// $data['name']         = $_REQUEST['name'];
		// $data['sale_cycle']   = $_REQUEST['sale_cycle'];
		// $data['brief_desc']   = $_REQUEST['brief_desc'];
		// $data['desc']         = $_REQUEST['desc'];
		// $data['spec']         = $_REQUEST['spec'];
		// $data['origin']       = $_REQUEST['origin'];
		// $data['unit_id']      = $_REQUEST['unit_id'];
		// $data['supply_begin'] = $_REQUEST['supply_begin'];
		// $data['supply_end']   = $_REQUEST['supply_end'];
		// $data['market_price'] = $_REQUEST['market_price'];
		// $data['sale_price']   = $_REQUEST['sale_price'];
		// $data['is_onsale']    = 0;
		// $data['is_cancle']    = 0;
		// $commodityInfo        = D('CommodityInfo');
		// $commodityInfo->data($data)->add();
		// $this->success('商品添加成功！');
	// }

	// public function update() {
		// $data['commodity_id'] = $_REQUEST['commodity_id'];
		// $data['name']         = $_REQUEST['name'];
		// $data['sale_cycle']   = $_REQUEST['sale_cycle'];
		// $data['brief_desc']   = $_REQUEST['brief_desc'];
		// $data['desc']         = $_REQUEST['desc'];
		// $data['spec']         = $_REQUEST['spec'];
		// $data['origin']       = $_REQUEST['origin'];
		// $data['unit_id']      = $_REQUEST['unit_id'];
		// $data['supply_begin'] = $_REQUEST['supply_begin'];
		// $data['supply_end']   = $_REQUEST['supply_end'];
		// $data['market_price'] = $_REQUEST['market_price'];
		// $data['sale_price']   = $_REQUEST['sale_price'];
		// $data['is_onsale']    = 0;
		// $data['is_cancle']    = 0;
		// $commodityInfo        = D('CommodityInfo');
		// $commodityInfo->where("commodity_id = '" . $data['commodity_id'] . "'")->save($data);
		// $this->success('商品修改成功！');
	// }

}
?>